<div style="clear:both;height:5px;"></div>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
		?>
		<link rel="stylesheet" type="text/css" href="/css/web1/sidebar2.css" media="all">
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
			<div class="head">
				<h4 style="width:85%;float:left"><?php echo $title;?></h4>
				<div style="float: right;">
				<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
				<ul class="gallery clearfix">
					<a href="/mostviewproduct/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
						<img src="/images/web1/Pencil.png" style="width:20px ; height:20px;"></img>
					</a>
				</ul>
				<?php }?>
				</div>
			</div>
			<div class="middle_box" >
				<div class="content">
					<div class="mini-most-view-products">
						<?php foreach ($MostViewProduct as $MostViewProduct){?>
				        	<div class="most-view-product-item">
				        		<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>" title=""><img class="producrt-image" src="<?php if($MostViewProduct['avatar'] != null){echo $MostViewProduct['avatar'];}else{echo "/images/img_thumb.gif";}?>" alt="" title=""></a>
								<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>"><h6 class="producrt-title"><?php echo $MostViewProduct['title'];?></h6></a>
								<p class="producct-view"><?php echo $text_view;?> <?php echo $MostViewProduct['views'];?></p>
				            </div>
				        <?php }?>
			        </div>
			    </div>
			</div>
			<div class="bottom_box"><span></span></div>
		</div>
		<?php 
	}
	else 
	{
		if($_SESSION['config_template']=='layoutmain_web2')
		{?>
		<link rel="stylesheet" type="text/css" href="/css/web2/sidebar2.css" media="all">
		    <!-- most view product -->
			<div class="top_box"><span> </span></div>
			<div class="box base-mini mini-most-view-products">
				<div class="head">
						<h4><?php echo $title;?>
						<div style="float: right;">
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<ul class="gallery clearfix">
							<a href="/mostviewproduct/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
								<img src="/images/web1/Pencil.png" style="width:20px ; height:20px;"></img>
							</a>
						</ul>
						<?php }?>
						</div>						
						</h4>
		        </div>
				<div class="content">
					<?php foreach ($MostViewProduct as $MostViewProduct){?>
			        	<div class="most-view-product-item">
			        		<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>" title=""><img class="producrt-image" src="<?php if($MostViewProduct['avatar'] != null){echo $MostViewProduct['avatar'];}else{echo "/images/img_thumb.gif";}?>" alt="<?php echo $MostViewProduct['title'];?>" title="<?php echo $MostViewProduct['title'];?>"></a>
							<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>"><h6 class="producrt-title"><?php echo $MostViewProduct['title'];?></h6></a>
							<p class="producct-view"><?php echo $text_view;?> <?php echo $MostViewProduct['views'];?></p>
			            </div>
		            <?php }?>
		        </div>
		    </div>
			<div class="bottom_box"><span> </span></div>
		    <!-- End most view product -->		
		<?php }
		else 
		{?>
			<style type="text/css">
			a:link {text-decoration:none;color:black;}    /* unvisited link */
			a:visited {text-decoration:none;} /* visited link */
			a:hover {text-decoration:underline;color:orange;}   /* mouse over link */
			a:active {text-decoration:underline;}  /* selected link */
			</style>
			
			<div style="clear:both;"></div>
			<div id="most_viewed_products">
				<div class="c_navigator">
					<p class="navi_content"><?php echo $title;?></p>
					<!-- Tạo cây bút chì cho click and change -->
						<div style="float: right; margin-right:5px">
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<ul class="gallery clearfix">
							<a href="/mostviewproduct/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
								<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:10px;"></img>
							</a>
						</ul>
						<?php  }?>
						</div>
					<!-- End - Tạo cây bút chì cho click and change -->
				</div> <!--end c_navigator-->
				<div style="margin-top:0;margin-right:5px;float:right;">
					<div style="margin-top:-5px;width:220px;height:auto;float:right;background:url(../images/box-small-r.gif) repeat-y;">				
						<?php foreach ($MostViewProduct as $MostViewProduct){?>
									<div style="margin-top:5px;">
										<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>">
											<img style="width:120px;height:120px;margin-left:52px;margin-right:62px;margin-top:5px;" src="<?php if($MostViewProduct['avatar'] != null){echo $MostViewProduct['avatar'];}else{echo "/images/img_thumb.gif";}?>" alt=""/>
										</a>
										
										<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>"><h6 style="text-align: center;">
											<?php echo $MostViewProduct['title'];?></h6>
										</a>
										
										<p style="text-align: center; width:100%; float:left; margin-top:0; margin-bottom:10px; font-size:9px;color:#FF8000;">
											<?php echo $text_view;?> <?php echo $MostViewProduct['views'];?>
										</p>
										<!--<div style="width:50%;margin-top:5px;float:right;" align="center">
											<a href="/index/detail?id=<?php echo $MostViewProduct['thing_id'];?>">
											<input type="button" name="btnDetails" style="background-image: url('../images/but_details2.png');color:white; border: none;text-align: center; font-size:11px;" value="<?php echo $btndetail ?>" class="btnDetail"/>
											</a>
										</div>-->
									</div>
						<?php }?>
					</div>	
				</div><!--end most_view_content-->					
			</div><!--end most_viewed_product-->
			
<?php }
	}
}?>
<div style="clear:both;"></div>